﻿<%@ Page Language="C#" AutoEventWireup="true" masterpagefile="~/Admin/Main.master"  title="子栏目列表" CodeFile="PageList.aspx.cs" Inherits="Admin_PageList" %>

<%@ Register TagPrefix="uc" TagName="ContentMenu" Src="~/Admin/ContentMenu.ascx"%>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftMenu" Runat="Server">
    <uc:ContentMenu ID="ContentMenu" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MidContent" Runat="Server">
  <div id="mainMenu">
  	<ul>
		<li>
            <asp:HyperLink ID="PageLink" runat="server">栏目内容</asp:HyperLink>
        </li>
        <li><a href="PageAdd.aspx">添加子栏目</a></li>
		<li><a href="PageList.aspx">子栏目列表</a></li>
		<li><a href="PageEdit.aspx">子栏目内容</a></li></ul>
  </div>
   <div id="main">
   <asp:Label id="Msg" runat="server" Text="" CssClass="msg" Visible="False"></asp:Label>
    <asp:GridView ID="PageList" runat="server" AllowPaging="True" AutoGenerateColumns="False" OnPageIndexChanging="PageList_PageIndexChanging" DataKeyNames="SinglePageId" OnRowCancelingEdit="PageList_RowCancelingEdit" OnRowEditing="PageList_RowEditing" OnRowUpdating="PageList_RowUpdating" PageSize="11" OnRowDeleting="PageList_RowDeleting" CellPadding="0" CssClass="gv" Width="100%" OnRowDataBound="PageList_RowDataBound" >
        <Columns>
            <asp:BoundField DataField="OrderId" HeaderText="排序号" >
                <ControlStyle CssClass="gvOrderId" />
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="栏目名称">
                <EditItemTemplate>
                    <asp:TextBox ID="PageTitle" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("TitleText") %>'></asp:Label>
                    <asp:HiddenField ID="ParentIdHiddenField" runat="server" Value='<%# Bind("ParentId") %>' />
                </ItemTemplate>
                <ItemStyle CssClass="gvLeftField" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="栏目标识">
                <EditItemTemplate>
                    <asp:TextBox ID="FileName" runat="server" Text='<%# Bind("FileName") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="FileName"
                        Display="Dynamic" ErrorMessage="必须填写"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileName"
                        Display="Dynamic" ErrorMessage="子栏目标识必须为小写字母或下划线组成" ValidationExpression="[a-z_]{0,50}"></asp:RegularExpressionValidator>
                    <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="FileName"
                        Display="Dynamic" ErrorMessage="已存在此标识" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("FileName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="摘要">
                <EditItemTemplate>
                    <asp:TextBox ID="desc" runat="server" Text='<%# Bind("PageDescribe") %>'></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidatorde" runat="server" ControlToValidate="FileName"
                        Display="Dynamic" ErrorMessage="必须为-50字符组成" ValidationExpression=".{0,50}"></asp:RegularExpressionValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Labelde" runat="server" Text='<%# Bind("PageDescribe") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                <EditItemTemplate>
                    <asp:Button ID="UpdateBt" runat="server" CausesValidation="True" CommandName="Update"
                        Text="更新" />
                    <asp:Button ID="CancelBt" runat="server" CausesValidation="False" CommandName="Cancel"
                        Text="取消" />    
                </EditItemTemplate>
                <ItemStyle CssClass="gvCommandField" />
                <ItemTemplate>
                    <asp:Button ID="EditBt" runat="server" Text="编辑" CausesValidation="false" CommandName="Edit" />
                    <asp:Button ID="DelBt" runat="server" CausesValidation="False" CommandName="Delete" Text="删除" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="内容管理">
                <ItemStyle CssClass="gvBtAField" />
                <ItemTemplate>
                    <asp:HyperLink ID="EditHyperLink" runat="server" NavigateUrl='<%# Eval("SinglePageId", "PageEdit.aspx?singlePageId={0}") %>'
                        Text="内容管理"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle CssClass="gvRow" />
        <EditRowStyle CssClass="gvEditRow" />
        <PagerStyle CssClass="gvPage" />
        <HeaderStyle CssClass="gvHeader" />
        <AlternatingRowStyle CssClass="gvAlternatingRow" />
    </asp:GridView>
  </div>
  <script language="JavaScript" type="text/javascript" >
        topMenuThisPage(2);//当前位置顶部菜单标识
        contentSubMenuThisPage();//当前位置左侧菜单标识
        mainMenuThisPage(3);//当前选项卡标识
  </script>
</asp:Content>


